<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>字符串</title>
	<!--<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>-->
</head>
<body>
<script>
	console.log("----------ASCII字符-----------");
	var a = "\x41";
	console.log(a);
	console.log("----------Unicode字符-----------");
	var b = "\u4e2d\u6587";
	console.log(b)
	console.log("----------多行字符串-----------");
	var c = `这是
	一个多行
	字符串`;
	console.log(c);
	console.log("----------模板字符串-----------");
	var name = "小明";
	var age = 20;
	var message = "你好，" + name + ",你今年" + age +"岁了";
	console.log(message)
	console.log(`你好,${name},你今年${age}岁了`)
	console.log("----------字符串操作-----------");
	var str = "Hello,World!";
	console.log("字符串长度:" + str.length);
	console.log("字符串索引在4位置处的字符" + str[4]);
	console.log("字符串全部大写：" + str.toUpperCase());
	console.log("字符串全部小写：" + str.toLowerCase());
	console.log("world字符串出现的位置：" + str.indexOf("world"));
	console.log("World字符串出现的位置：" + str.indexOf("World"));
	console.log("str.subString(0,5):" + str.substring(0,5));
	console.log("str.subString(7):" + str.substring(7))
</script>
</body>
</html>